package com.huiyeji.hui.service;

import com.huiyeji.hui.entity.Group;
import com.huiyeji.hui.utils.PageUtil;
import com.huiyeji.hui.vo.PageResult;
import com.huiyeji.hui.vo.SelfAndOthersAndGroupsVo;
import com.huiyeji.hui.vo.SimpleGroupVo;

import java.util.List;

/**
 * @author zhaoduo
 */
public interface GroupService {

    /**
     * 得到源用户所有群聊信息
     * @param uid 源用户uid
     * @return groups
     */
    List<SelfAndOthersAndGroupsVo.Group> getGroups(Long uid);

    /**
     * 更改群聊名称
     * @param uid uid
     * @param gid gid
     * @param groupName groupName
     */
    void changeGroupName(Long uid, Long gid, String groupName);

    /**
     * 更改群聊公告
     * @param uid uid
     * @param gid gid
     * @param notice notice
     */
    void changeGroupNotice(Long uid, Long gid, String notice);

    /**
     * 根据key搜索群聊
     * @param uid 源用户id
     * @param pp KeyPageParam
     * @return PageResult
     */
    PageResult<SimpleGroupVo> keySearch(Long uid, PageUtil.KeyPageParam pp);

    /**
     * 根据条件查询
     * @param uid 源用户id
     * @param pp ConditionPageParam
     * @return PageResult
     */
    PageResult<SimpleGroupVo> conditionSearch(Long uid, PageUtil.GroupConditionPageParam pp);

    /**
     * 解散群聊
     * @param uid uid
     * @param gid gid
     */
    void deleteGroup(Long uid, Long gid);

    /**
     * 创建群聊
     * @param group group
     */
    void createGroup(Group group);

    /**
     * 得到简单群聊数据
     * @param gid gid
     * @return SimpleGroupVo
     */
    SimpleGroupVo selectSimpleGroup(Long gid);

    /**
     * 得到一个群聊的基本信息(包括包括成员id集合)
     * @param uid uid
     * @param gid gid
     * @return Group
     */
    SelfAndOthersAndGroupsVo.Group getGroup(Long uid, Long gid);
}
